# Maintainer: Peter Budai <peterbudai at hotmail dot com>

_realname=Text-CharWidth
pkgname=perl-${_realname}
pkgver=0.04
pkgrel=6
pkgdesc="Text::CharWidth - Get number of occupied columns of a string on terminal"
arch=('i686' 'x86_64')
url="https://metacpan.org/${_realname}/"
groups=("perl-modules")
license=('GPL' 'PerlArtistic')
depends=("perl" "libcrypt")
makedepends=("perl-devel")
options=('!emptydirs')
source=(https://www.cpan.org/authors/id/K/KU/KUBOTA/${_realname}-${pkgver}.tar.gz)
sha256sums=('abded5f4fdd9338e89fd2f1d8271c44989dae5bf50aece41b6179d8e230704f8')

prepare() {
  cd "${srcdir}/${_realname}-${pkgver}"
}

build() {
  cd "${srcdir}/${_realname}-${pkgver}"

  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make test
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make install DESTDIR=${pkgdir}
}
